package IO;

import java.io.File;
import java.io.IOException;

public class Create {
    public static void main(String[] args) throws IOException {


        File file=new File("e:/a.txt");
        if (file.mkdir())
            System.out.println("创建成功");
        else
            System.out.println("创建失败");


        File fileSon =new File("e:/a.txt/b.txt");
        fileSon.createNewFile();


        File file1=new File("e:/b.txt");
        if (file1.mkdir())
            System.out.println("创建成功");
        else
            System.out.println("创建失败");



        File file2=new File("e:/b.txt/b.txt");
        if(fileSon.renameTo(file2))
            System.out.println("移动成功");
        else
            System.out.println("移动失败");



        file.deleteOnExit();
        file1.deleteOnExit();
        file2.deleteOnExit();



    }
}
